package com.ley.yikang.service.serviceimpl;

import com.ley.yikang.entity.Child;
import com.ley.yikang.entity.Elder;
import com.ley.yikang.entity.ElderAndChildBind;
import com.ley.yikang.mapper.ElderAndChildBindMapper;
import com.ley.yikang.service.ElderAndChildBindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ElderAndChildBindServiceImpl implements ElderAndChildBindService {
    private final ElderAndChildBindMapper elderAndChildBindMapper;

    @Autowired
    public ElderAndChildBindServiceImpl(ElderAndChildBindMapper elderAndChildBindMapper) {
        this.elderAndChildBindMapper = elderAndChildBindMapper;
    }

    @Override
    public void bindChildAndElder(int childId, int elderId) {
        elderAndChildBindMapper.bindChildAndElder(childId, elderId);
    }

    @Override
    public ElderAndChildBind getChildAndElderInfo(int childId, int elderId) {
        return elderAndChildBindMapper.getChildAndElderInfo(childId, elderId);
    }

    @Override
    public List<Child> getElderAndChild(int elderId) {
        return elderAndChildBindMapper.getElderAndChild(elderId);
    }

    @Override
    public List<Elder> getChildAndElder(int childId) {
        return elderAndChildBindMapper.getChildAndElder(childId);
    }

    @Override
    public void unbindChildAndElder(int childId, int elderId) {
        elderAndChildBindMapper.unbindChildAndElder(childId, elderId);
    }

    @Override
    public void delChildAndElder(int childId) {
        elderAndChildBindMapper.delChildAndElder(childId);
    }

    @Override
    public void delElderAndChild(int elderId) {
        elderAndChildBindMapper.delElderAndChild(elderId);
    }
}
